<template>
  <div class="member-home">
    <!-- 概览 -->
    <HomeOverview />
    <!-- 收藏 -->
    <HomePanel title="我的收藏">
      <GoodsItem v-for="goods in collectArr" :key="goods.id" :goods="goods" />
    </HomePanel>
    <!-- 足迹 -->
    <HomePanel title="我的足迹">
        <GoodsItem v-for="goods in collectArr" :key="goods.id" :goods="goods" />
    </HomePanel>
    <!-- 猜你 -->
    <GoodsRelevant />
  </div>
</template>
<script>
import {ref} from 'vue'
import HomeOverview from "./components/home-overview.vue";
import HomePanel from "./components/home-panel.vue";
import GoodsRelevant from "@/views/goods/components/goods-relevant";
import GoodsItem from "@/views/category/components/goods-item";
import { findCollect } from "@/api/member";

export default {
  name: "MemberHome",
  components: { HomeOverview, HomePanel, GoodsRelevant, GoodsItem },
  setup(props) {

    const collectArr = ref([])
    findCollect({
      page: 1,
      pageSize: 4,
    }).then((res) => {
       collectArr.value = res.result.items
    });

    return { collectArr };
  },
};
</script>
<style scoped lang="less">
.member-home {
}
</style>